package com.webserver.controller;

import com.google.zxing.qrcode.encoder.QRCode;
import com.webserver.core.DispatcherServlet;
import com.webserver.entity.Article;
import com.webserver.http.HttpServletRequest;
import com.webserver.http.HttpServletResponse;
import qrcode.QRCodeUtil;

import java.io.File;
import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.net.URISyntaxException;

/**
 * @author 马强
 * @Description
 * @create 2022-04-15 19:53
 */
public class ToolsController {
    public void creatQR(HttpServletRequest request , HttpServletResponse response){
        String message =request.getParameter("message");
        try {
            QRCodeUtil.encode(message,"./zlw.jpg",response.getOutputStream(),true);
            response.setContentType("image/jpeg");
        } catch (Exception e) {
            e.printStackTrace();
        }

    }


}
